package Test;

import domain.Teachaer;

import java.util.ArrayList;

public class Demo17 {
    public static void main(String[] args) {
        /*
        * 请定义教师（Teacher）类，属性包含姓名和专业名称。
        * 将若干教师对象存入ArrayList集合中，并遍历集合打印教师信息，格式如下：
姓名：赵老师, 专业：javase
姓名：钱老师, 专业：javaee
姓名：孙老师, 专业：php
姓名：李老师, 专业：python
 */
        ArrayList<Teachaer> list = new ArrayList<>();

        Teachaer te = new Teachaer("赵老师","javase");
        Teachaer te1 = new Teachaer("钱老师","javaee");
        Teachaer te2 = new Teachaer("孙老师","php");
        Teachaer te3 = new Teachaer("李老师","python");
        list.add(te);
        list.add(te1);
        list.add(te2);
        list.add(te3);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).getName()+"..."+list.get(i).getZhuanYe());
        }
    }
}
